<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-lx-calendar"></i> 写题解</el-breadcrumb-item>
                <el-breadcrumb-item>编辑器</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
<!--            <div class="plugins-tips">-->
<!--            </div>-->
            <quill-editor ref="myTextEditor" v-model="content" :options="editorOption" style='min-height: 800px; max-height: 800px'></quill-editor>
            <div style='text-align: center'>
                <el-button type='info' plain round style='width: 100px; padding: 10px; position:relative; top: 20px'>
                    <div style='font-family: "黑体"; font-size: 20px'>
                        提交
                    </div>
                </el-button>
                <el-button type='info' plain round style='width: 100px; padding: 10px; position:relative; top: 20px'
                           @click='this.content=""'>
                    <div style='font-family: "黑体"; font-size: 20px'>
                        清除
                    </div>
                </el-button>
            </div>
        </div>
    </div>
</template>

<script>
    import 'quill/dist/quill.core.css';
    import 'quill/dist/quill.snow.css';
    import 'quill/dist/quill.bubble.css';
    import { quillEditor } from 'vue-quill-editor';
    export default {
        name: 'editor',
        data: function(){
            return {
                content: '',
                editorOption: {
                    placeholder: 'Hello World'
                }
            }
        },
        components: {
            quillEditor
        },
        methods: {
            onEditorChange({ editor, html, text }) {
                this.content = html;
            },
            submit(){
                console.log(this.content);
                this.$message.success('提交成功！');
            }
        }
    }
</script>
<style scoped>
    .editor-btn{
        margin-top: 20px;
    }
</style>